/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * TelaCaixa.java
 *
 * Created on 13/04/2010, 14:03:58
 */

package br.com.pi.SmartFast.view;

import br.com.pi.SmartFast.controler.ControleTelaCaixa;

/**
 *
 * @author webmaster
 */
public class TelaCaixa extends javax.swing.JFrame {

    ControleTelaCaixa control ;

    /** Creates new form TelaCaixa */
    public TelaCaixa() {
        initComponents();
        control = new ControleTelaCaixa(jlista_pedidos, jCombo_forma_pagamento, this,lbl_consumo,
                jTextFieldTotalPago,jTextFieldTroco);
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jLabelCaixaPalavra = new javax.swing.JLabel();
        jLabelPedidosPalavra = new javax.swing.JLabel();
        jLabelTotalPago = new javax.swing.JLabel();
        jTextFieldTotalPago = new javax.swing.JTextField();
        jLabelR$ = new javax.swing.JLabel();
        jLabelR$2 = new javax.swing.JLabel();
        jTextFieldTroco = new javax.swing.JTextField();
        jLabelTroco = new javax.swing.JLabel();
        jBFecharConta = new javax.swing.JButton();
        jCombo_forma_pagamento = new javax.swing.JComboBox();
        jLabel1 = new javax.swing.JLabel();
        jScrollPane1 = new javax.swing.JScrollPane();
        jlista_pedidos = new javax.swing.JList();
        lbl_consumo = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setUndecorated(true);
        addWindowListener(new java.awt.event.WindowAdapter() {
            public void windowOpened(java.awt.event.WindowEvent evt) {
                formWindowOpened(evt);
            }
        });

        jLabelCaixaPalavra.setIcon(new javax.swing.ImageIcon(getClass().getResource("/br/com/pi/SmartFast/imagens/imgCaixaPalavra.png"))); // NOI18N

        jLabelPedidosPalavra.setIcon(new javax.swing.ImageIcon(getClass().getResource("/br/com/pi/SmartFast/imagens/imgPedidosPalavra.png"))); // NOI18N

        jLabelTotalPago.setFont(new java.awt.Font("Tahoma", 1, 18));
        jLabelTotalPago.setText("TOTAL PAGO");

        jTextFieldTotalPago.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyReleased(java.awt.event.KeyEvent evt) {
                jTextFieldTotalPagoKeyReleased(evt);
            }
        });

        jLabelR$.setFont(new java.awt.Font("Tahoma", 1, 14));
        jLabelR$.setText("R$");

        jLabelR$2.setFont(new java.awt.Font("Tahoma", 1, 14));
        jLabelR$2.setText("R$");

        jTextFieldTroco.setEditable(false);

        jLabelTroco.setFont(new java.awt.Font("Tahoma", 1, 18));
        jLabelTroco.setText("TROCO");

        jBFecharConta.setIcon(new javax.swing.ImageIcon(getClass().getResource("/br/com/pi/SmartFast/imagens/imgFecharConta4.png"))); // NOI18N
        jBFecharConta.setContentAreaFilled(false);
        jBFecharConta.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBFecharContaActionPerformed(evt);
            }
        });

        jLabel1.setText("Forma de Pagamento");

        jlista_pedidos.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jlista_pedidosMouseClicked(evt);
            }
        });
        jScrollPane1.setViewportView(jlista_pedidos);

        lbl_consumo.setText("valor consumo");

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addGap(435, 435, 435)
                .addComponent(jLabelCaixaPalavra, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGap(412, 412, 412))
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGap(228, 228, 228)
                        .addComponent(jLabelPedidosPalavra, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addGroup(layout.createSequentialGroup()
                        .addGap(96, 96, 96)
                        .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 258, Short.MAX_VALUE)
                        .addGap(35, 35, 35)))
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGap(122, 122, 122)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jCombo_forma_pagamento, 0, 200, Short.MAX_VALUE)
                            .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
                                .addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addGap(98, 98, 98))
                            .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
                                .addGap(25, 25, 25)
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(layout.createSequentialGroup()
                                        .addComponent(jLabelTotalPago)
                                        .addGap(31, 31, 31))
                                    .addGroup(layout.createSequentialGroup()
                                        .addComponent(jLabelR$, javax.swing.GroupLayout.DEFAULT_SIZE, 19, Short.MAX_VALUE)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                        .addComponent(jTextFieldTotalPago, javax.swing.GroupLayout.PREFERRED_SIZE, 116, javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addGroup(layout.createSequentialGroup()
                                        .addComponent(jLabelTroco)
                                        .addGap(81, 81, 81))
                                    .addGroup(layout.createSequentialGroup()
                                        .addComponent(lbl_consumo, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                        .addGap(76, 76, 76)))
                                .addGap(30, 30, 30)))
                        .addGap(323, 323, 323))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addGroup(layout.createSequentialGroup()
                                .addGap(82, 82, 82)
                                .addComponent(jBFecharConta, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                            .addGroup(layout.createSequentialGroup()
                                .addGap(141, 141, 141)
                                .addComponent(jLabelR$2, javax.swing.GroupLayout.DEFAULT_SIZE, 19, Short.MAX_VALUE)
                                .addGap(18, 18, 18)
                                .addComponent(jTextFieldTroco, javax.swing.GroupLayout.DEFAULT_SIZE, 175, Short.MAX_VALUE)))
                        .addGap(292, 292, 292))))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jLabelCaixaPalavra)
                        .addGap(17, 17, 17)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(layout.createSequentialGroup()
                                .addGap(38, 38, 38)
                                .addComponent(jLabel1)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(jCombo_forma_pagamento, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(48, 48, 48)
                                .addComponent(lbl_consumo)
                                .addGap(43, 43, 43)
                                .addComponent(jLabelTotalPago)
                                .addGap(18, 18, 18)
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(jLabelR$)
                                    .addComponent(jTextFieldTotalPago, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGap(28, 28, 28)
                                .addComponent(jLabelTroco)
                                .addGap(18, 18, 18)
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(jTextFieldTroco, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jLabelR$2))
                                .addGap(73, 73, 73)
                                .addComponent(jBFecharConta))
                            .addComponent(jLabelPedidosPalavra)))
                    .addGroup(layout.createSequentialGroup()
                        .addGap(145, 145, 145)
                        .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 378, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(221, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void formWindowOpened(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowOpened

        control.telaAoabrir();
        
    }//GEN-LAST:event_formWindowOpened

    private void jlista_pedidosMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jlista_pedidosMouseClicked

        control.listaMesasDuploClique(evt.getClickCount());
        
    }//GEN-LAST:event_jlista_pedidosMouseClicked

    private void jTextFieldTotalPagoKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTextFieldTotalPagoKeyReleased

        control.textoDinheiroAoclicar();
        
    }//GEN-LAST:event_jTextFieldTotalPagoKeyReleased

    private void jBFecharContaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBFecharContaActionPerformed

        control.botaoFecharConta();
        
    }//GEN-LAST:event_jBFecharContaActionPerformed

    /**
    * @param args the command line arguments
    */
//    public static void main(String args[]) {
//        java.awt.EventQueue.invokeLater(new Runnable() {
//            public void run() {
//                new TelaCaixa().setVisible(true);
//            }
//        });
//    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jBFecharConta;
    private javax.swing.JComboBox jCombo_forma_pagamento;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabelCaixaPalavra;
    private javax.swing.JLabel jLabelPedidosPalavra;
    private javax.swing.JLabel jLabelR$;
    private javax.swing.JLabel jLabelR$2;
    private javax.swing.JLabel jLabelTotalPago;
    private javax.swing.JLabel jLabelTroco;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JTextField jTextFieldTotalPago;
    private javax.swing.JTextField jTextFieldTroco;
    private javax.swing.JList jlista_pedidos;
    private javax.swing.JLabel lbl_consumo;
    // End of variables declaration//GEN-END:variables

}
